Conversation
scranford1
commented
Dec 8, 2025
- Initial implementation of the Environmental Data Retrieval (EDR) standard for the OGC server.
jdw-creare
left a comment
There was a problem hiding this comment.
This all looks great! I had a couple comments, but I feel like it already meets the bar for merging. Feel free to merge at any time!
ogc/edr/edr_routes.py
Outdated
| @property | ||
| def api(self) -> pygeoapi.api.API: | ||
| """Property for the API created using a custom configuration. | ||
|
|
||
| Returns | ||
| ------- | ||
| pygeoapi.api.API | ||
| The API which handles all EDR requests. | ||
| """ | ||
| # Allow specifying GeoTiff or CoverageJSON in the format argument. | ||
| # This is a bypass which is needed to get by a conditional check in pygeoapi. | ||
| pygeoapi.plugin.PLUGINS["formatter"]["GeoTiff"] = "" | ||
| pygeoapi.plugin.PLUGINS["formatter"]["CoverageJSON"] = "" | ||
|
|
||
| config = EdrConfig.get_configuration(self.base_url, self.layers) | ||
| open_api = get_oas(config, fail_on_invalid_collection=False) | ||
| EdrProvider.set_resources(self.layers) | ||
| return pygeoapi.api.API(config=deepcopy(config), openapi=open_api) | ||
|
|
There was a problem hiding this comment.
Is the pygeoapi.api.API object something we can safely create once on startup and re-use every request? I'm not sure how long it takes to create, but I click into that constructor and see methods like "load_plugin" and "deep_copy", which sometimes are the kind of thing that has a non-trivial load time. If we can safely re-use it, it might be a free performance gain.
There was a problem hiding this comment.
Good point, I think my initial thought was that if the layers change the API needs to be updated to match it. But it may be worth trying to find a better way to make that happen.
There was a problem hiding this comment.
Updated to observe layer changes and only update the API when a layer change occurs.
| base_url = tl.Unicode(default_value="http://127.0.0.1:5000/") | ||
| layers = tl.List(trait=tl.Instance(pogc.Layer), default_value=[]) | ||
|
|
There was a problem hiding this comment.
If you wind up instantiating the pygeoapi.api.API object just once, then these could become just parameters to __init__, just to keep this class as stateless as possible
|
|
Updates Based on Review:
|
|
This looks great, thanks Sam! |


